/**
 * Created by heht on 2017/3/27.
 */
import CommonUtil from 'common/common.util'
import LocalDAO from 'common/localDAO'
import _ from 'underscore'
import router from '.././router'

/**
 * 远程接口数据访问对象
 *
 * @class common.remoteDAO
 */
var RemoteDAO = {};

/**
 * 登录
 * @param callback
 */
RemoteDAO.callNativeLogin = function (callback) {
  console.log('gtjanrng://register');
  var self = this;
  Bridge.callByJsUrl('gtjanrng://register', function (response) {
    console.log('gtjanrng://register', response);
    /*
     * {'ret' :{ 'error':'0','data':{'user_code':'12342','nick_name':'sdsdsd'}},' jsToken':'1'}
     * */
    if (Number(response.error) === 1) {
      console.log('原生登录-error：', response.data);
      callback(response)
    } else {
      console.log('原生登录-data：', response);
      var userCode = response.data.user_code;
      var nickName = response.data.nick_name;
      LocalDAO.setUserCode(userCode);
      LocalDAO.setNickname(nickName);
      //判断是否有账单的渠道码
      var channelcode = CommonUtil.getUrlParam('channelcode') || '';
      var kv = {};
      if (channelcode !== '') {
        kv = {'usercode': userCode, 'channelcode': channelcode}
      } else {
        kv = {'usercode': userCode};
      }
      TDAPP.onEvent('2012', '', kv);
      TDAPP.send();

      if (response.data.registerFlag == '1') {
        self.initRegisterSucc();
      } else {
        callback(response);
      }
    }
  }, 'gtjanrng')
};

/**
 * 初次注册成功弹窗
 */
RemoteDAO.initRegisterSucc = function () {
  var wrapTag = document.createElement('div');
  wrapTag.className = 'register_succ-wrap';
  wrapTag.style.position = 'fixed';
  wrapTag.style.width = '100%';
  wrapTag.style.backgroundColor = 'rgba(0, 0, 0, 0.6)';
  wrapTag.style.overflowY = 'scroll';
  wrapTag.style.display = 'block';
  wrapTag.style.top = '0';
  wrapTag.style.bottom = '0';
  wrapTag.style.zIndex = '1099';

  var imgTag = document.createElement('img');
  imgTag.src = 'https://dl.app.gtja.com/nrng/shareimages/register_succ.png';
  imgTag.style.width = '100%';
  wrapTag.appendChild(imgTag);

  var btnWrap = document.createElement('div');
  btnWrap.style.textAlign = 'center';
  var btnTag = document.createElement('div');
  btnTag.style.fontSize = '1.7rem';
  btnTag.style.color = 'white';
  btnTag.style.borderRadius = '1rem';
  btnTag.style.padding = '6px 10px';
  btnTag.style.backgroundColor = 'rgba(250, 179, 67, 1)';
  btnTag.style.minWidth = '60%';
  btnTag.style.display = 'inline-block';
  btnTag.innerHTML = '好的，我也去～';
  btnTag.onclick = function () {
    wrapTag.style.display = 'none';
    window.location.reload(true);
  };

  btnWrap.appendChild(btnTag);
  wrapTag.appendChild(btnWrap);
  document.body.appendChild(wrapTag);
};
/**
 * 查询信息数
 * @param stock_code
 * @param callback
 */
RemoteDAO.callNativeMessageNum = function (callback) {
  Bridge.callByJsUrl('gtjanrng://messageNum', function (response) {
    /*
     * {'ret' :{ 'error':'0','data':{'message_no':'12'}},' jsToken':'1'}
     * */

    if (_.isFunction(callback)) {
      callback(response);
    }
  }, '10007')
};

/**
 * 设置原生头像
 * @param callback
 */
RemoteDAO.callNativeSetHeader = function (callback) {
  Bridge.callByJsUrl('gtjanrng://setHeader', function (response) {
    callback(response);

    if (response.error == '0') {
      var userHead = response.data.userhead;
      LocalDAO.setUserHead(userHead);
    }
  }, '1')
};

/**
 * 开户
 * @param callback
 */
RemoteDAO.callBuildAccount = function(callback) {
  Bridge.callByJsUrl("gtjanrng://sjkh", function(response){
    callback(response);
  },"sjkh");
};

/**
 * 股票搜索
 * @param stock_code
 * @param callback
 */
RemoteDAO.callNativeSearchStock = function (stock_code, callback) {
  Bridge.callByJsUrl('gtjanrng://searchStock?stockcode=' + stock_code, function (data) {
    console.log('原生股票搜索', data);
    callback(data);
  }, '1')
};
/**
 * 实时行情调用
 * @param stock_codes
 * @param callback
 */
RemoteDAO.callNativeLiveStockPrice = function (stock_codes, callback) {
  Bridge.callByJsUrl('gtjanrng://liveStockPrice?stockcode=' + stock_codes, function (ret) {
    console.log('原生实时行情调用', ret);
    callback(ret);
  }, '2')
};

/**
 * 五档
 * @param stock_code
 * @param callback
 */
RemoteDAO.callNativeFivePrice = function (stock_code, callback) {
  var time1 = new Date();
  console.log(time1.getSeconds());
  Bridge.callByJsUrl('gtjanrng://fivePrice?stockcode=' + stock_code, function (data) {
    console.log('原生五档行情调用', data);
    var time2 = new Date();
    console.log(time2.getTime() - time1.getTime());
    callback(data);
  }, '1')
};

/**
 * 行情调用规则
 * @param callback
 */
RemoteDAO.callStockLive = function (stock_code, h5module, islogin, callback) {
  Bridge.callByJsUrl('gtjanrng://callQuotation?stockcode='
    + stock_code + '&h5module=' + h5module + '&islogin=' + islogin, function (response) {
    var data = response.data;
    //处理注册逻辑
    if (data.nickname !== '' && typeof(data.nickname) !== undefined) {
      LocalDAO.setUserCode(data.usercode);
      LocalDAO.setNickname(data.nickname);
    }
    //处理跳转到买入还是卖出还是撤单的页面
    var menuId = "/buyin", stockMarket = data.stockcode.slice(0, 2);
    if (data.tradedirection == 'sell') {
      menuId = "/sellout";
    } else if (data.tradedirection == 'cancel') {
      menuId = "/cancel";
    }
    var stockCd = (stockMarket === 'SH' ) ? '1' : '0';
    //处理跳转逻辑
    if (data.niurenflag === '0') {
      router.push({path: '/otherdetail', query: {userCode : data.niurencode}});
    } else {
      switch (data.h5module) {
        case 'combination':
          if (_.isFunction(callback)) {
            callback(response);
          }
          break;
        case 'ordinary':
          router.push({path: '/trade' + menuId, query: {stockCode : data.stockcode.slice(2), marketCd : stockCd, stockName : encodeURI(data.stockname)}});
          break;
        case "game":
          router.push({path: '/trade' + menuId, query: {stockCode : data.stockcode.slice(2), marketCd : stockCd, stockName : encodeURI(data.stockname),gameId : data.gameId}});
          break;
      }
    }
  }, '10006-1')
};

/**
 * 行情调用规则-比赛
 * @param callback
 */
RemoteDAO.callStockLiveGame = function (stock_code, game_id, h5module, callback) {
  Bridge.callByJsUrl('gtjanrng://callQuotation?stockcode='
    + stock_code + '&gameId=' + game_id + '&h5module=' + h5module + '&islogin=1', function (data) {
    var data = response.data;
    //处理注册逻辑
    if (data.nickname !== '' && typeof(data.nickname) !== undefined) {
      LocalDAO.setUserCode(data.usercode);
      LocalDAO.setNickname(data.nickname);
    }

    if (_.isFunction(callback)) {
      callback(data);
    }
  }, '10006-2')
};

/**
 * 查询我的自选股列表
 * @param callback
 */
RemoteDAO.callSelfList = function (callback) {
  Bridge.callByJsUrl('gtjanrng://getMyStockList', function (data) {
    if (data.error == 0) {
      console.log('getMyStockList-自选股数组-data：', data.data);
    } else {
      console.log('getMyStockList-自选股数组-error：', data.data);
    }
    if (_.isFunction(callback)) {
      callback(data);
    }
  }, '99999')
};

/**
 *添加我的自选股
 * @param stockcode
 * @param stockname
 * @param callback
 */
RemoteDAO.addMyStock = function (stockcode, stockname, callback) {
  Bridge.callByJsUrl('gtjanrng://addMyStock?stockcode=' + stockcode + '&stockname=' + stockname, function (data) {
    console.log('加自选：', data);
    if (_.isFunction(callback)) {
      callback(data);
    }
  }, '99999')
};

/**
 *删除我的自选股
 * @param stockcode
 * @param stockname
 * @param callback
 */
RemoteDAO.deleteMyStock = function (stockcode, stockname, callback) {
  Bridge.callByJsUrl('gtjanrng://deleteMyStock?stockcode=' + stockcode + '&stockname=' + stockname, function (data) {
    console.log('删自选：', data);
    if (_.isFunction(callback)) {
      callback(data);
    }
  }, '99999')
};

/**
 * 获取服务器时间
 * @param usercode      用户代码
 * @param gameid        比赛id
 * @param callback      回调函数
 * response = {
     *      data:{
     *          body:{
     *              date: 20161125,
     *              time: 183724
     *          }
     *      },
     *      error: '0'
     * }
 */
RemoteDAO.callGT1008 = function (callback) {
  var paramData = {};
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error === '0') {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;

        console.log('GT1008-data:', response);
      } else {
        console.error('GT1008-error', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'expert_niugu',
    'tranCode': 'GT1008',
    'jsToken': 'expert_niugu4',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam);
};


/**
 *  分享
 * @param title     分享题目
 * @param content   分享的内容
 * @param linkurl   链接
 * @param moments 表示分享到朋友圈是使用title还是content,或是都拼在一起  title/content/all
 */
RemoteDAO.share = function (title, content, linkurl, moments, icon) {
  var shareid = LocalDAO.getShareid() || CommonUtil.getUrlParam('shareid');
  window.location.href = 'gtjayyznormal://yyzShare?activitycode=201611_NRNG&title=' + title + '&icon=' + icon + '&content=' + content + '&moments=' + moments +'&linkurl=' + linkurl + '&shareid='+shareid + '&activitycode=201611_NRNG';
};

/**
 * 热搜接口
 * @param searchtype     搜索类型   1 牛人 2 组合 3 股票 4 比赛
 * @param callback      回调函数
 */
RemoteDAO.hotSearch = function (searchtype, callback) {
  var paramData = {
    'search_type': searchtype + ''
  };
  var param = CommonUtil.setToken(paramData)
  var bridgeParam = {
    callback: function (response) {
      if (response.error === '0') {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        console.log('response.error =0,hotSearch-热搜接口:' + result)
      } else {
        console.error('hotSearch-热搜接口:', response);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'expert_niugu',
    'tranCode': 'GT1004',
    'jsToken': 'expert_niugu4',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam);
};

/**
 * 查询交易日接口
 * @param callback
 * * response = {
     *      data:{
     *          body:[{
     *              next_trade_date: '20161125'
     *          }]
     *      },
     *      error:'0'
     * }
 */
RemoteDAO.getTradeDate = function (callback) {
  Bridge.callByJS({
    callback: function (response) {
      if (response.error === '0') {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;

        console.log('获取交易时间:', response);
      } else {
        console.error('获取交易时间-error', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'stock_related',
    'tranCode': 'GT1001',
    'jsToken': 'stock_related',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {
      'stage_num': '0',
      'app': 'pubs',
      // 'cif_account':'',
      // 'gt_iwm_id':'',
      // 'client_name':'',
      // 'user_token':'',
      //  'phone_no':'',
      // 'password':'',
      // 'branch_no':'',
      // 'sysnode_id':'',
      // 'busin_account':'',
    }
  })
};


/**
 * 基金模糊查询接口
 * @param searchStr  搜索的关键字
 * @param callback
 *
 */
RemoteDAO.fundSearch = function (searchStr,callback) {
  Bridge.callByJS({
    callback: function (response) {
      if (response.error === '0') {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;

        console.log('基金模糊查询:', response);
      } else {
        console.error('基金模糊查询-error', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'fund_nrng',
    'tranCode': 'GT1001',
    'jsToken': 'fund_nrng',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {
      'vague': searchStr + ''
    }
  })
};

/**
 * 将需要分享的数据传送到后台接口
 * @param pagename
 * @param callback
 */
RemoteDAO.sendShareData = function (pagename, callback) {
  var nickname = LocalDAO.getNickname();
  var usercode = LocalDAO.getUserCode();
  var shareContent = localStorage.getItem(pagename);
  if (nickname === '') {
    usercode = parseInt(Math.random() * 100000);
  }
  var url = 'https://dl.app.gtja.com/yyz/data/api/niurenshare/share';
  $.ajax({
    url: url,
    type: 'POST',
    dataType: 'json',
    contentType: 'application/json;charset=UTF-8',
    data: JSON.stringify({usercode: usercode, type: pagename, content: shareContent}),
    success: function (data) {
      if (_.isFunction(callback)) {
        callback(data.url);
      }
    },
    error: function (e) {
      alert('error:'+JSON.stringify(e));
    }
  })
};

/**
 * 用于iOS打印日志，需要启动10.176.118.19:8080服务器
 * @param content
 * @private
 */
RemoteDAO._log = function (content) {
  $.ajax({
    method: 'GET',
    url: 'https://10.176.118.19:8080/api/log/receive',
    dataType: 'text',
    data: {
      classString: 'clock',
      methodName: 'test',
      content: content
    },
    success: function (data) {
      console.log(data);
    }
  })
};

/**
 * 12000004：获取当前用户 userCode
 * @method callUC12000004
 * @param callback 回调函数
 */
RemoteDAO.callUC12000004 = function (callback) {
  Bridge.callByJS({
    callback: function (response) {
      if (response.error == '0') {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        console.log('12000004-获取当前用户-data:' + object.body[0].USER_CODE)
      } else {
        console.log('12000004-获取当前用户-error:', response.data);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'h5',
    'tranCode': 'UC12000004',
    'jsToken': '12000004',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {
      'OP_SITE': '127.0.0.1',
      'OP_PROGRAM': '',
      'BRANCH_NO': '0',
      'TOKEN_SERIAL_NO': '0',
      'USER_TOKEN': '',
      'func_id': '12000004',
      'CUST_CODE': '',
      'USER_CODE': '0',
      'PASSWORD': '',
      'terminal_source': '02' // 必须加
    },
    'localParameter': {'mobile': 'ACCT_CODE,phone_no,mobile', 'password': 'stock_pwd'}
  })
};

/**
 * 用户行为操作记录
 * @param userCode
 * @param actionFlag 操作标志 A:增加  U：更新  D：删除
 * @param acctType 身份类型 0-一户通账号 1-资金账号 2-身份证号   4-QQ号  5-客户代码  6：注册手机号  7：股东账号   8：基金账号
 * @param acctCode 对应的身份号码
 * @param behaviorFlag 行为标志 L:login（登录）  QD:签到  HY:活跃  TG:偷看  NGQD：牛股签到
 * @param sysSource 系统来源
 *                  00：一户通终端 01：网上商城 02：易阳指  03：富易  04：小额贷款  05：百事通
 *                  06：组合大本营  07：国泰君安官网 08：网上营业厅 10：新富易  11：渠道推广 12：i理财
 * @param remark 备注
 * @param callback
 */
RemoteDAO.callUC12000022 = function (userCode, actionFlag, acctType, acctCode, behaviorFlag, sysSource, remark, callback) {
  Bridge.callByJS({
    callback: function (response) {
      if (response.error == '1') {
        console.log('12000022-用户行为操作记录-error:', response)
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        console.log('12000022-用户行为操作记录-data:', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12000022',
    'jsToken': 'UC12000022',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {
      'FUNC_ID': '12000022',
      'OP_BRANCH_NO': '0',
      'OP_SITE': '127.0.0.1',
      'OP_PROGRAM': '',
      'BRANCH_NO': '0',
      'PASSWORD': '',
      'USER_TOKEN': '',
      'TOKEN_SERIAL_NO': '0',
      'USER_CODE': userCode,
      'ACTION_FLAG': actionFlag,
      'ACCT_TYPE': acctType,
      // 'ACCT_CODE': acctCode,
      'BEHAVIOR_FLAG': behaviorFlag,
      'SYS_SOURCE': sysSource,
      'REMARK': remark
    },
    'localParameter': {'mobile': 'ACCT_CODE,phone_no', 'password': 'stock_pwd'}
  })
};

/**
 * 用户行为操作记录数查询
 * @param args
 * @param callback
 * args{[userCode,behaviorFlag,sysSource,behaviorDate]}
 */
RemoteDAO.callUC12000023 = function (args, callback) {
  Bridge.callByJS({
    callback: function (response) {
      if (response.error == '1') {
        console.log('12000023-用户行为操作记录数查询-error:', response)
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;

        console.log('12000023-用户行为操作记录数查询-data:', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12000023',
    'jsToken': 'UC12000023',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {
      'FUNC_ID': '12000023',
      'OP_BRANCH_NO': '0',
      'OP_SITE': '127.0.0.1',
      'OP_PROGRAM': '',
      'BRANCH_NO': '0',
      'PASSWORD': '',
      'TOKEN_SERIAL_NO': '0',
      'USER_CODE': args.USER_CODE,
      'USER_TOKEN': '',
      'BEHAVIOR_FLAG': args.BEHAVIOR_FLAG,
      'SYS_SOURCE': args.SYS_SOURCE,
      'BEHAVIOR_DATE': args.BEHAVIOR_DATE
    },
    'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
  })
};

/**
 * 12000042：勋章查询
 * @method callUC12000042
 * @param userCode 用户代码
 * @param configType 荣誉勋章类型
 * @param callback 回调函数
 */
RemoteDAO.callUC12000042 = function (userCode, configType, callback) {
  var paramData = {
    'OP_SITE': '127.0.0.1',
    'OP_PROGRAM': '',
    'BRANCH_NO': '0',
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'func_id': '12000042',
    'mobile': '',
    'PASSWORD': '',
    'terminal_source': '02',
    // 'USER_CODE': userCode,
    'CONFIG_TYPE': configType
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('12000042-荣誉勋章查询-error:', response.data)
      } else {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('12000042-荣誉勋章查询-data:', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12000042'+configType,
    'jsToken': 'UC12000042',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 任务墙接口
 * @param params
 * CONFIG_TYPE   当BUSIN_TYPE为NRNGXSRW：牛人牛股新手任务
 当BUSIN_TYPE为NRNGCGRW：牛人牛股常规任务
 * @param callback
 */
RemoteDAO.callUC12000048 = function (params, callback) {
  var paramData = {
    'FUNC_ID': '12000048',
    'OP_SITE': '127.0.0.1',
    'OP_PROGRAM': '',
    'OP_CODE': '8888',
    // 'USER_CODE' : params.USER_CODE +'',
    'BRANCH_NO': '0',
    'PASSWORD': '',
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'BUSIN_TYPE': 'TASK',
    'CONFIG_TYPE': params.config_type
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '0') {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('12000048-data:', response);
      } else {
        console.log('12000048-error:', response);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12000048',
    'jsToken': 'UC12000048',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 公告接口
 * @param relationId   团队赛的id
 */
RemoteDAO.callUC12000054 = function (params, callback) {
  var paramData = {
    'FUNC_ID': '12000054',
    'OP_SITE': '127.0.0.1',
    'OP_PROGRAM': '',
    'OP_CODE': '8888',
    'BRANCH_NO': '0',
    'PASSWORD': '',
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'BUSIN_TYPE': 'NRNG',
    'RELATION_ID': params.relationId + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error === '0') {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('12000054-data:', response);
      } else {
        console.log('12000054-error:', response);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12000054',
    'jsToken': 'UC12000054',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};


/**
 * 12000103：用户资料修改
 * @param args
 * @param callback
 */
RemoteDAO.callUC12000103 = function (args, callback) {
  Bridge.callByJS({
      callback: function (response) {
        if (response.error == '1') {
          console.log('12000103-用户资料修改-data:' + response.data)
        } else {
          var result = decrypt.json2(response.data);
          var object = JSON.parse(result);
          response.data = object;

          console.log('12000103-用户资料修改-data:', response)
        }

        if (_.isFunction(callback)) {
          callback(response)
        }
      },
      'id': 'nrng_yh',
      'tranCode': 'UC12000103',
      'jsToken': 'UC12000103',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': {
        'OP_SITE': '127.0.0.1',
        'OP_PROGRAM': '',
        'BRANCH_NO': '0',
        'USER_TOKEN': '',
        'TOKEN_SERIAL_NO': '0',
        'func_id': '12000103',
        'CUST_CODE': '',
        'USER_CODE': args.USER_CODE,
        'PASSWORD': '',
        'IS_AUDIT': args.IS_AUDIT,
        'USER_HEAD': args.USER_HEAD,
        'NICKNAME': args.NICKNAME,
        'BUSIN_TYPE': args.BUSIN_TYPE,
        'SUBSCRIBE_PRICE': args.SUBSCRIBE_PRICE,
        'ACTIVITY_CODE': args.ACTIVITY_CODE
      },
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};

/**
 * 12000104：用户资料查询
 * @param userCode
 * @param callback
 */
RemoteDAO.callUC12000104 = function (userCode, callback) {
  //设置md5验证
  var token = md5('127.0.0.1M' + userCode + '0');
  var paramData = {
    'OP_SITE': '127.0.0.1',
    'OP_PROGRAM': '',
    'BRANCH_NO': '0',
    'USER_TOKEN': token,
    'TOKEN_SERIAL_NO': '2016000000000011003000040020000000000000000000000000000000000000001212126868000000000000000000000000',
    'func_id': '12000104',
    'CUST_CODE': '',
    'USER_CODE': userCode + '',
    'PASSWORD': '',
    'BUSIN_TYPE': 'NRNG'
  };
  var param = CommonUtil.setToken(paramData);
  Bridge.callByJS({
      callback: function (response) {
        if (response.error == '1') {
          console.log('12000104-用户资料查询-error:', response)
        } else {
          //以后要加上判断nickname!==''的判断
          var result = decrypt.json2(response.data);
          var object = JSON.parse(result);
          response.data = object;

          console.log('12000104-用户资料查询-data:', response);
        }

        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'h5',
      'tranCode': 'UC12000104',
      'jsToken': 'UC12000104',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': param
    }
  )
};

/**
 * 12000109：用户事件跟踪登记
 * @param userCode
 * @param activityCode
 * @param callback
 */
RemoteDAO.callUC12000109 = function (userCode, activityCode, markType, callback) {
  Bridge.callByJS({
      callback: function (response) {
        if (response.error == '1') {
          console.log('12000109-用户事件跟踪登记-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;

          console.log('12000109-用户事件跟踪登记-data:', response);
        }

        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng_yh',
      'tranCode': 'UC12000109',
      'jsToken': 'UC12000109',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': {
        'OP_SITE': '127.0.0.1',
        'OP_PROGRAM': '',
        'BRANCH_NO': '0',
        'USER_TOKEN': '',
        'TOKEN_SERIAL_NO': '0',
        'PASSWORD': '',
        'func_id': '12000109',
        'USER_CODE': userCode,
        'ACTIVITY_CODE': activityCode,
        'MARK_TYPE': markType
      },
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};

/**
 * 勋章兑换接口
 * @param params
 * @param callback
 */
RemoteDAO.callUC12000325 = function (params, callback) {
  var paramData = {
    'FUNC_ID': '12000325',
    'OP_SITE': '127.0.0.1',
    'OP_PROGRAM': '',
    'OP_CODE': '8888',
    // 'USER_CODE' : params.USER_CODE +'',
    'BRANCH_NO': '0',
    'PASSWORD': '',
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'ACTIVITY_CODE': '201611_NRNG',
    'WALLET_CODE': params.wallet_code,
    'WALLET_NUM': params.wallet_num,
    'EX_WALLET_CODE': params.ex_wallet_code
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '0') {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('12000325-data:', response);
      } else {
        console.log('12000325-error:', response);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12000325',
    'jsToken': 'UC12000325',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 自选股更新
 * @param userCode
 * @param terminalSource
 * @param batchFlag
 * @param idType
 * @param batchData
 * @param remark
 * @param callback
 */
//[{'STOCK_CODE':stockCode +'','SHOW_ORDER':showOrder +'','MARKET_CODE':marketCode +'','GROUP_NO':groupNo +'','REMARK':remark +''}]
RemoteDAO.callUC12008112 = function (userCode, terminalSource, batchFlag, idType, batchData, remark, callback) {
  Bridge.callByJS({
    callback: function (data) {
      var error = data.error;
      if (error == 1) {
        console.log('12008112自选股更新:' + data.data);
      } else {
        var result = decrypt.json2(data.data);
        var object = JSON.parse(result);
        console.log('12008112自选股更新:', object);
        if (_.isFunction(callback)) {
          callback(object);
        }
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'GT1003',
    'jsToken': '12008112',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {
      'FUNC_ID': '12008112',
      'OP_BRANCH_NO': '0',
      'OP_SITE': '127.0.0.1',
      'OP_PROGRAM': '',
      'BRANCH_NO': '0',
      'PASSWORD': '',
      'USER_CODE': userCode + '',
      'USER_TOKEN': '',
      'TOKEN_SERIAL_NO': '0',
      'TERMINAL_SOURCE': terminalSource + '',
      'BATCH_FLAG': batchFlag + '',
      'ID_TYPE': idType + '',
      'BATCH_DATA': batchData + '',
      'REMARK': remark + ''
    },
    'localParameter': {'mobile': 'ID_CODE', 'password': 'SOCKET_PWD'}
  })
};

/**
 * 12008301：牛人信息查询(0：牛人排行榜 1：自己已订阅  9：随机)
 * @param  userCode 用户代码
 * @param  actionType 0：牛人排行榜 1：自己已订阅  9：随机
 * @param  pageSize 每页行数
 * @param  pageNo 页码
 * @param  totalFlag
 * @param  callback
 */
RemoteDAO.callUC12008301 = function (userCode, actionType, pageSize, pageNo, totalFlag, callback) {
  //修改trancode,来配合君君做缓存
  var trancode = 'UC12008301';
  if (actionType === '0') {
    trancode = 'JCL30012';
  }
  var paramData = {
    'OP_SITE': '127.0.0.1',
    'OP_PROGRAM': '',
    'BRANCH_NO': '0',
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'func_id': '12008301',
    'PASSWORD': '',
    // 'USER_CODE': userCode + '',
    'ACTION_TYPE': actionType + '',
    'PAGE_SIZE': pageSize + '',
    'PAGE_NO': pageNo + '',
    'TOTAL_FLAG': totalFlag
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (Number(response.error) === 1) {
        console.log('12008301-牛人信息查询-error' + response.data)
      } else {
        /*
         * {'USER_CODE':'40801','USER_HEAD':'','NICKNAME':'BULL01','TOTAL_RATE':'300.090000',
         * 'USER_TAG_LIST':'No.1 Bull','WIN_RATE':'98.000000','OP_COUNT_MONTH':'10000',
         * 'MAX_LOSE':'10','WAVE_RATE':'30.000000','SUBSCRIBE_USER_COUNT':'0','FRIEND_FLAG':''}
         * */
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;

        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('12008301-牛人信息查询-data', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng_yh',
    'tranCode': trancode,
    'jsToken': 'UC12008301',
    'isEncrypt': 'false',
    'transmitMode': 'get'
    // 'param':,
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam);
};

/**
 * 查询比赛
 * @param userCode
 * @param gameId        gameId为''则获取所有比赛
 * @param gameStatus    比赛状态：0-待审核 1-审核通过 2-审核
 * @param pageSize      分页大小，一般为10
 * @param pageNum       分页目录，从1开始
 * @param gameKind      比赛种类0：个人  1：官方
 * @param gameType      比赛类型，个人赛：NETDS,团队赛：TDS，精英赛： JYS，车轮赛：CLS，可以不穿或传空
 * @param upGameId      上一级的比赛id，查询子团队赛时使用
 * @param gameStep      0:未开始报名 1:报名中 2:报名结束 3:比赛中 4:比赛结束
 * @param isPwd         0:没有密码 1:有密码
 * @param order         1:开始时间正序 2:加入人数正序 3:资金池正序 (取负值时为逆序)
 * @param callback
 */
RemoteDAO.callUC12008302 = function (param, callback) {
  // if (typeof userCode === 'undefined' || userCode == '') {
  //     userCode = '0'
  // }
  var paramData = {
    'FUNC_ID': '12008302',
    'OP_CODE': '8888',
    'OP_BRANCH_NO': '0',
    'OP_SITE': '127.0.0.1',
    'OP_WAY': '0',
    'OP_PROGRAM': '',
    'BRANCH_NO': '0',
    'PASSWORD': '',
    // 'USER_CODE':userCode + '',
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'GAME_ID': (param.gameId || '') + '',
    'GAME_STATUS': (param.gameStatus || '') + '',
    'PAGE_SIZE': param.pageSize + '',
    'PAGE_NO': param.pageNum + '',
    'GAME_KIND': (param.gameKind || '') + '',
    'GAME_TYPE': (param.gameType || '') + '',
    'UP_GAME_ID': (param.upGameId || '') + '',
    'GAME_STEP': (param.gameStep ||　'') + '',
    'IS_PWD': (param.isPwd || '') + '',
    'ORDER': (param.order || '') + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (Number(response.error) === 0) {
        var result = decrypt.json2(response.data);
        response.data = JSON.parse(result);
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('12008302-查询比赛-data：', response);
      } else {
        console.log('12008302-查询比赛-error：', response);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12008302',
    'jsToken': 'UC12008302',
    'isEncrypt': 'false',
    'transmitMode': 'get'
    // 'param':param
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 我的比赛查询,
 * @param userCode
 * @param ACTION_FLAG 0：所有  1：参加   2：创建
 * @param PAGE_SIZE
 * @param PAGE_NO
 * @param totalFlag
 * @param gameKind
 * @param {String} gameID 比赛ID 仅当action flag为1时此game ID用于查询用户是否参加了该比赛
 * @param callback
 */
// RemoteDAO.callUC12008303 = function (userCode, ACTION_FLAG, PAGE_SIZE, PAGE_NO, totalFlag, gameKind, callback) {
RemoteDAO.callUC12008303 = function (params, callback) {
  //设置md5验证
  var token = md5('127.0.0.1M' + params.userCode + '0');
  var paramData = {
    'FUNC_ID': '12008303',
    'OP_SITE': '127.0.0.1',
    'OP_PROGRAM': '',
    'BRANCH_NO': '0',
    'PASSWORD': '',
    'USER_TOKEN': token,
    'TOKEN_SERIAL_NO': '2016000000000011003000040020000000000000000000000000000000000000001212126868000000000000000000000000',
    'USER_CODE': params.userCode + '',
    'ACTION_FLAG': params.actionFlag + '',
    'PAGE_SIZE': params.pageSize + '',
    'PAGE_NO': params.pageNo + '',
    'TOTAL_FLAG': params.totalFlag ? params.totalFlag + '' : '',
    'GAME_KIND': params.gameKind ? params.gameKind + '' : '',
    'GAME_ID': params.gameID ? params.gameID : ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('12008303-我的比赛查询-ERROR:', response)
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('12008303-param', JSON.stringify(paramData));
        console.log('12008303-我的比赛查询-JSON:', response);

        /*
         *{'USER_CODE':'49008','GAME_ID':'201610110000000718','GAME_NAME':'MMtest3','GAME_TYPE':'1',
         * 'BEGIN_DATE':'20160920','END_DATE':'20170920','GAME_AMOUNT':'100.000000','GAME_MAX_LIMIT':'200',
         * 'GAME_ATTEND_PERSON':'0','GAME_STATUS':'S','GAME_NEED_AMOUNT':'0','TOTAL_PROFIT':'0.000000',
         * 'GAME_JOIN_BEGIN_DATE':'20160919','GAME_JOIN_END_DATE':'20170101'}
         * */
      }

      if (_.isFunction(callback)) {
        callback(response)
      }
    }, 'id': 'h5',
    'tranCode': 'UC12008303',
    'jsToken': '2',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': param
  };
  Bridge.callByJS(bridgeParam)
};

/**
 * 比赛报名
 * @param userCode
 * @param gameId
 * @param gamePWD       比赛口令
 * @param inviteUser    邀请人userCode
 * @param callback
 */
RemoteDAO.callUC12008304 = function (userCode, gameId, gamePWD, inviteUser, callback) {
  Bridge.callByJS({
    callback: function (response) {
      if (response.error == '1') {
        console.error('12008304-比赛报名-error', response);
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;

        console.log('12008304-比赛报名-data', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12008304',
    'jsToken': 'UC12008304',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {
      'FUNC_ID': '12008304',
      'OP_CODE': '8888',
      'OP_BRANCH_NO': '0',
      'OP_SITE': '127.0.0.1',
      'OP_WAY': '0',
      'OP_PROGRAM': '',
      'BRANCH_NO': '0',
      'PASSWORD': '',
      'USER_CODE': userCode + '',
      'USER_TOKEN': '',
      'TOKEN_SERIAL_NO': '0',
      'GAME_ID': gameId + '',
      'GAME_PWD': gamePWD + '',
      'INVITE_USER': inviteUser + ''
    }, 'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
  })
};

/**
 * 牛人都在看
 * @param userCode
 * @param pageSize
 * @param pageNo
 * @param callback
 */
RemoteDAO.callUC12008305 = function (userCode, pageSize, pageNo, callback) {
  var paramData = {
    'func_id': '12008305',
    'OP_BRANCH_NO': '0',
    'OP_SITE': '127.0.0.1',
    'OP_PROGRAM': '',
    'BRANCH_NO': '0',
    'PASSWORD': '',
    // 'USER_CODE':userCode +'',
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'PAGE_SIZE': pageSize + '',
    'PAGE_NO': pageNo + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (Number(response.error) == 0) {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('12008305牛人都在看-data:', object);
      } else {
        console.log('12008305牛人都在看-error:', response);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    }, 'id': 'nrng_yh',
    'tranCode': 'UC12008305',
    'jsToken': 'UC12008305',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 订阅管理
 * userCode
 * actionType
 * businType
 * communityType
 * objectType
 * relationUserCode
 * relationUserName
 * beginDate
 * endDate
 * communityContent
 * topicCode
 * topicName
 * serialNo
 * @param args
 * @param callback
 *
 */
RemoteDAO.callUC12008306 = function (args, callback) {
  //处理enddate和begindata为空的情况
  if (args.beginDate === '') {
    var date = new Date();
    args.beginDate = date.getFullYear().toString() + (date.getMonth() + 1).toString() + date.getDate().toString()
  }
  if (args.endDate === '') {
    var date = new Date();
    args.endDate = (date.getFullYear() + 10).toString() + (date.getMonth() + 1).toString() + date.getDate().toString()
  }
  Bridge.callByJS({
    callback: function (response) {
      if (Number(response.error) === 1) {
        console.error('12008306-订阅管理-error:', response);
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        console.log('12008306-订阅管理-param:', JSON.stringify(args));
        console.log('12008306-订阅管理-success:', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }

    }, 'id': 'nrng_yh', 'tranCode': 'GT1003', 'jsToken': '111', 'isEncrypt': 'false', 'transmitMode': 'get', 'param': {
      'FUNC_ID': '12008306',
      'OP_BRANCH_NO': '0',
      'OP_SITE': '127.0.0.1',
      'OP_PROGRAM': '',
      'BRANCH_NO': '0',
      'PASSWORD': '',
      'USER_CODE': args.userCode + '',
      'USER_TOKEN': '',
      'TOKEN_SERIAL_NO': '0',
      'ACTION_TYPE': args.actionType + '',
      'BUSIN_TYPE': args.businType + '',
      'COMMUNITY_TYPE': args.communityType + '',
      'OBJECT_TYPE': args.objectType + '',
      'RELATION_USER_CODE': args.relationUserCode + '',
      'RELATION_USER_NAME': args.relationUserName + '',
      'BEGIN_DATE': args.beginDate + '',
      'END_DATE': args.endDate + '',
      'COMMUNITY_CONTENT': args.communityContent + '',
      'TOPIC_CODE': args.topicCode + '',
      'TOPIC_NAME': args.topicName + '',
      'SERIAL_NO': args.serialNo
    },
    'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
  })
};

/**
 * 创建比赛
 * @param callback          回调方法
 * @param userCode
 * @param password          用户密码
 * @param gameName
 * @param gameType          比赛类型
 * @param gameKind          比赛种类 0：个人 1：官方
 * @param joinBeginDate     报名开始时间
 * @param joinEndDate       报名截止时间
 * @param beginDate         比赛开始时间
 * @param endDate           比赛结束时间
 * @param gameAmount        比赛总积分
 * @param joinGameAmount    加入比赛需要扣除的积分
 * @param gameMaxLimit      比赛人数上限
 * @param gamePWD           比赛口令
 * @param remark            备注
 * @param gameId            比赛编号
 * @param erhNO             员工号
 * @param joinInitAmount    参赛人的初始资金
 * @param commounityFlag    交流标志
 * @param activityCode      活动代码
 * @param createrNickname   创建人昵称
 * @param createrHead       创建人头像
 */
RemoteDAO.callUC12008307 = function (callback, userCode, password, gameName, joinInitAmount, gameType, gameKind, joinBeginDate, joinEndDate, beginDate, endDate,
                                     gameAmount, joinGameAmount, gameMaxLimit, gamePWD, remark, gameId, erhNO, commounityFlag, activityCode, createrNickname, createrHead) {
  if (remark == undefined) remark = '';
  if (gameId == undefined) gameId = '';
  if (erhNO == undefined) erhNO = '';
  if (joinInitAmount == undefined) joinInitAmount = '';
  if (commounityFlag == undefined) commounityFlag = '';
  if (activityCode == undefined) activityCode = '';
  if (createrNickname == undefined) createrNickname = '';
  if (createrHead == undefined) createrHead = '';

  Bridge.callByJS({
    callback: function (data) {
      if (_.isFunction(callback)) {
        callback(data)
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'GT1002',
    'jsToken': '1',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {

      'GAME_NAME': gameName + '',
      'GAME_TYPE': gameType + '',
      'GAME_KIND': gameKind + '',
      'BEGIN_DATE': beginDate + '',
      'END_DATE': endDate + '',
      'GAME_AMOUNT': gameAmount + '',
      'JOIN_GAME_AMOUNT': joinGameAmount + '',
      'JOIN_BEGIN_DATE': joinBeginDate + '',
      'JOIN_END_DATE': joinEndDate + '',
      'GAME_MAX_LIMIT': gameMaxLimit + '',
      'CREATE_USER': userCode + '',
      'REMARK': remark + '',
      'GAME_PWD': gamePWD + '',
      'GAME_ID': gameId + '',
      'EHR_NO': erhNO + '',
      'JOIN_INIT_AMOUNT': joinInitAmount + '',
      'COMMUNITY_FLAG': commounityFlag + '',
      'ACTIVITY_CODE': '201611_NRNG',
      'CREATER_NICKNAME': createrNickname + '',
      'CREATER_HEAD': createrHead + '',
      'CREATER_COMPANY': '',
      'CREATER_BRANCH_NO': '',

      'OP_CODE': '8888',
      'OP_BRANCH_NO': '0',
      'OP_SITE': '127.0.0.1',
      'OP_WAY': '0',
      'OP_PROGRAM': '',
      'USER_CODE': userCode + '',
      'BRANCH_NO': '0',
      'FUNC_ID': '12008307',
      'USER_TOKEN': '',
      'TOKEN_SERIAL_NO': '0'
    }, 'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd,PASSWORD'}
  })
};

/**
 * 好友管理
 * @param userCode
 * @param actionType
 * @param acctType
 * @param callback
 */
RemoteDAO.callUC12008308 = function (userCode, actionType, acctType, callback) {
  Bridge.callByJS({
    callback: function (data) {
      var error = data.error;
      if (error == 1) {
        console.log('12008308好友管理:' + data.data)
      } else {
        var result = decrypt.json2(data.data);
        var object = JSON.parse(result);
        console.log('12008308好友管理:', object);
        if (_.isFunction(callback)) {
          callback()
        }
      }

    }, 'id': 'nrng_yh', 'tranCode': 'GT1003', 'jsToken': '8', 'isEncrypt': 'false', 'transmitMode': 'get', 'param': {
      'FUNC_ID': '12008308',
      'OP_BRANCH_NO': '0',
      'OP_SITE': '127.0.0.1',
      'OP_PROGRAM': '',
      'BRANCH_NO': '0',
      'PASSWORD': '',
      'USER_CODE': userCode + '',
      'USER_TOKEN': '',
      'TOKEN_SERIAL_NO': '0',
      'ACTION_TYPE': actionType + '',
      'ACCT_TYPE': acctType + ''
    },
    'localParameter': {'mobile': 'phone_no,ACCT_CODE', 'password': 'stock_pwd'}
  })
};

/**
 * 订阅查询
 * @param userCode
 * @param pageSize
 * @param pageNo 页码从1开始
 * @param communityType
 * @param objectType
 * @param communityStatus
 * @param topicCode
 * @param relationUserCode
 * @param communitySide
 * @param callback
 */

RemoteDAO.callUC12008309 = function (userCode, pageSize, pageNo, communityType, objectType,
                                     communityStatus, topicCode, relationUserCode, communitySide, callback) {
  Bridge.callByJS({
    callback: function (response) {
      if (response.error == 1) {
        console.log('12008309订阅查询-error:', response);
      } else {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        console.log('12008309订阅查询-data:', response)
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12008309',
    'jsToken': 'UC12008309',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {
      'FUNC_ID': '12008309',
      'OP_BRANCH_NO': '0',
      'OP_SITE': '127.0.0.1',
      'OP_PROGRAM': '',
      'BRANCH_NO': '0',
      'PASSWORD': '',
      'USER_CODE': userCode + '',
      'USER_TOKEN': '',
      'TOKEN_SERIAL_NO': '0',
      'PAGE_SIZE': pageSize + '',
      'PAGE_NO': pageNo + '',
      'COMMUNITY_TYPE': communityType + '',
      'OBJECT_TYPE': objectType + '',
      'COMMUNITY_STATUS': communityStatus + '',
      'TOPIC_CODE': topicCode + '',
      'RELATION_USER_CODE': relationUserCode + '',
      'COMMUNITY_SIDE': communitySide + ''
    }, 'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
  })
};

/**
 * 全文检索
 * @param userCode
 * @param businType
 * @param keyWord
 * @param callback
 * @param pageSize
 * @param pageNo
 * @param topicId
 */
RemoteDAO.callUC12008310 = function (params,callback) {
  var paramData = {
    "FUNC_ID":"12008310",
    "OP_BRANCH_NO":"0",
    "OP_SITE":"127.0.0.1",
    "OP_PROGRAM":"",
    "BRANCH_NO":"0",
    "PASSWORD":"",
    // "USER_CODE":userCode +"",
    "USER_TOKEN":"",
    "TOKEN_SERIAL_NO":"0",
    "BUSIN_TYPE": params.businType +"",
    "KEYWORD": params.keyWord +"",
    "PAGE_SIZE": params.pageSize+"",
    "PAGE_NO": params.pageNo+"",
    "TOPIC_ID": params.topicId ? params.topicId + "" : ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback:function(data){
      var error= data.error;
      if(error == 1){
        console.log("12008310全文检索:"+data.data);
        if (_.isFunction(callback)) {
          callback(data);
        }
      }else{
        var result = decrypt.json2(data.data);
        var object = JSON.parse(result);
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log("12008310全文检索:", object);
        if (_.isFunction(callback)) {
          callback(object);
        }
      }
    },"id":"nrng_yh",
    "tranCode":"UC12008310",
    "jsToken":"10",
    "isEncrypt":"false",
    "transmitMode":"get"
  };
  var finalParam = CommonUtil.setTouristParam(param,bridgeParam);
  Bridge.callByJS(finalParam);
};

/**
 * 查询买卖原因
 * @param callback
 */
RemoteDAO.callUC12008312 = function (callback) {
  var paramData = {
    'FUNC_ID': '12008312',
    'OP_SITE': '127.0.0.1',
    'OP_PROGRAM': '',
    'OP_CODE': '8888',
    // 'USER_CODE' : '0',
    'BRANCH_NO': '0',
    'PASSWORD': '',
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'BUSIN_TYPE': 'NRNG'
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error === '0') {
        var result = decrypt.json2(response.data);
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header)
      } else {
        console.log('UC12008312-查询买卖原因-error', response.data)
      }
      callback(response)
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12008312',
    'jsToken': 'UC12008312',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 社交统计
 * userCode
 * communityType
 * @param args
 * @param callback
 */
RemoteDAO.callUC12008314 = function (args, callback) {
  var paramData = {
    'FUNC_ID': '12008314',
    'OP_BRANCH_NO': '0',
    'OP_SITE': '127.0.0.1',
    'OP_PROGRAM': '',
    'BRANCH_NO': '0',
    'PASSWORD': '',
    // 'USER_CODE':args.USER_CODE,
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'COMMUNITY_STATUS': args.COMMUNITY_STATUS,
    'COMMUNITY_TYPE': args.COMMUNITY_TYPE
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('12008314-社交统计-error:', response)
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('12008314-社交统计-param', JSON.stringify(param));
        console.log('12008314-社交统计-data:', response)
      }

      if (_.isFunction(callback)) {
        callback(response)
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12008314',
    'jsToken': 'UC12008314',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam);
};

/**
 * 比赛报名人员查询
 * 出参：
 * GAME_ID: '201610110000000718'
 * INVITE_USER: '0'
 * JOIN_DATE: '0'
 * JOIN_TIME: '0'
 * REMARK: ''
 * USER_CODE: '41009'
 * USE_GAME_AMOUNT: '0.000000'
 * @param userCode
 * @param gameId
 * @param callback
 */
RemoteDAO.callUC12008315 = function (userCode, gameId, callback) {
  var paramData = {
    'FUNC_ID': '12008315',
    'OP_CODE': '8888',
    'OP_BRANCH_NO': '0',
    'OP_SITE': '127.0.0.1',
    'OP_WAY': '0',
    'OP_PROGRAM': '',
    'BRANCH_NO': '0',
    'PASSWORD': '',
    // 'USER_CODE':userCode + '',
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'GAME_ID': gameId + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (str.error == '1') {
        console.error('UC12008315-error: ' + response.data)
      } else {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('比赛报名人员查询,param:userCode=' + userCode + '||gameId=' + gameId);
        console.log('UC12008315:', object);
        if (_.isFunction(callback)) {
          callback(response);
        }
      }
    }, 'id': 'nrng_yh',
    'tranCode': 'GT1003',
    'jsToken': '2',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 批量查询用户信息
 * @param userCode 当前用户代码
 * @param userCodes 多个用户代码，用半角的逗号隔开
 * @param callback 回调函数
 */
RemoteDAO.callUC12008316 = function (userCode, userCodes, callback) {
  var paramData = {
    'FUNC_ID': '12008316',
    'OP_CODE': '8888',
    'OP_BRANCH_NO': '0',
    'OP_SITE': '127.0.0.1',
    'OP_WAY': '0',
    'OP_PROGRAM': '',
    'BRANCH_NO': '0',
    'PASSWORD': '',
    // 'USER_CODE':userCode,
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'USER_CODES': userCodes
  };
  var param = CommonUtil.setToken(paramData)
  var bridgeParam = {
    callback: function (response) {
      if (Number(response.error) === 1) {
        console.log('12008316-批量查询用户信息-error：', response.data)
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('12008316-批量查询用户信息-data：', response);
      }
      if (_.isFunction(callback)) {
      callback(response);
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12008316',
    'jsToken': 'UC12008316',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 查询比赛评论
 * @param params
 * @param callback
 */
RemoteDAO.callUC12008318 = function (params, callback) {
  var paramData = {
    'FUNC_ID': '12008318',
    'OP_SITE': '127.0.0.1',
    'OP_PROGRAM': '',
    'OP_CODE': '8888',
    // 'USER_CODE' : params.USER_CODE +'',
    'BRANCH_NO': '0',
    'PASSWORD': '',
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'GAME_ID': params.ID + '',
    'PAGE_SIZE': params.PAGE_SIZE + '',
    'PAGE_NO': params.PAGE_NO + '',
    'COMMUNITY_STATUS': '1',
    'OBJECT_TYPE': '4',
    //查询标志 1-查个人 0或空－查该比赛的所有评论
    'QUERY_FLAG': params.QUERY_FLAG + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '0') {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('12008318-data:', response.data);
      }
      if (_.isFunction(callback)) {
        callback(response)
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12008318',
    'jsToken': 'UC12008318',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam);
};

/**
 * 12008319：比赛牛人
 * @method callUC12008319
 * @param  userCode 用户代码
 * @param  pageSize 每页行数
 * @param  pageNo 页码
 * @param callback
 */
RemoteDAO.callUC12008319 = function (userCode, pageSize, pageNo, callback) {
  var paramData = {
    'OP_SITE': '127.0.0.1',
    'OP_PROGRAM': '',
    'BRANCH_NO': '0',
    'USER_TOKEN': '',
    'TOKEN_SERIAL_NO': '0',
    'func_id': '12008319',
    'PASSWORD': '',
    //'USER_CODE': userCode + '',
    'PAGE_SIZE': pageSize + '',
    'PAGE_NO': pageNo + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('12008319-比赛牛人列表-error' + response.data)
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;

        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('12008319-比赛牛人列表-data', response)
      }

      if (_.isFunction(callback)) {
        callback(response)
      }
    },
    'id': 'nrng_yh',
    'tranCode': 'UC12008319',
    'jsToken': 'UC12008319',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 投票页列表接口
 * @param params
 * @param callback
 */
RemoteDAO.callUC12008320 = function (params, callback) {
  var paramData = {
    "FUNC_ID":"12008320",
    "OP_SITE":"127.0.0.1",
    "OP_PROGRAM":"",
    "OP_CODE":"8888",
    // "USER_CODE" : params.USER_CODE +"",
    "BRANCH_NO":"0",
    "PASSWORD" : "",
    "USER_TOKEN" :"",
    "TOKEN_SERIAL_NO" : "0",
    "GAME_ID" : params.gameId,
    "PAGE_SIZE" :params.pageSize,
    "PAGE_NO" : params.pageNo
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {callback:function(response){
    if(response.error == '0'){
      var result = decrypt.json2(response.data);
      var object = JSON.parse(result);
      response.data = object;
      //增加存入token的逻辑
      CommonUtil.saveyyzToken(JSON.parse(result).header);
      console.log("12008320-data:" ,response);
    }else{
      console.log("12008320-error:" ,response);
    }
    if(_.isFunction(callback)){
      callback(response);
    }
  },
    "id":"nrng_yh",
    "tranCode":"UC12008320",
    "jsToken":"UC12008320",
    "isEncrypt":"false",
    "transmitMode":"get"
  };
  var finalParam = CommonUtil.setTouristParam(param,bridgeParam);
  Bridge.callByJS(finalParam);
};

/**
 * 个人资产概况：
 * @param clientId
 * @param callback
 */
RemoteDAO.callJCL11103 = function (clientId, callback) {
  var paramData = {
    'func_id': '11103',
    'type': 'zmq',
    'client_id': clientId
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('11103-个人资产概况-error:', response.data)
      } else {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('11103-个人资产概况-data:', object)
      }

      if (_.isFunction(callback)) {
        callback(response)
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL11103',
    'jsToken': 'JCL11103',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam);
};

/**
 * 查询最大可买/卖
 *
 * @param obj
 * @param callback
 */
RemoteDAO.callJCL11114 = function (obj, callback) {
  var entrust_type = '1';
  if (!_.isEmpty(obj.groupId)) {
    entrust_type = '2'
  }
  if (!_.isEmpty(obj.gameId)) {
    entrust_type = '3'
  }
  var param = {
    'func_id': '11114',
    'type': 'zmq',
    'client_id': obj.clientId,
    'USER_CODE': obj.clientId,
    'exchange_type': obj.marketCd,
    'stock_code': obj.stockCode,
    'entrust_price': obj.tradePrice,
    'entrust_bs': obj.entrustBs,
    'entrust_type': entrust_type,
    'entrust_typeid': _.isEmpty(obj.gameId) ? obj.groupId : obj.gameId
  };
  console.log('11114-买卖委托-param', param);
  //alert(param.entrust_bs)
  Bridge.callByJS({
      callback: function (response) {
        callback(response)
      },
      'id': 'nrng',
      'tranCode': 'JCL11114',
      'jsToken': 'JCL11114',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': param,
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};

/**
 * 撤单接口
 * @param obj
 * @param callback
 */
RemoteDAO.callJCL11115 = function (obj, callback) {
  var param = {
    'func_id': '11115',
    'type': 'zmq',
    'client_id': obj.client_id + "",
    'USER_CODE': obj.client_id + "",
    'exchange_type': obj.exchange_type + "",
    'stock_code': obj.stock_code + "",
    'entrust_no': obj.entrust_no + ""
  };
  Bridge.callByJS({
      callback: function (response) {
        callback(response)
      },
      'id': 'nrng',
      'tranCode': 'JCL11115',
      'jsToken': 'JCL11115',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': param,
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};


/**
 * 买卖委托
 *
 * @param obj
 * @param callback
 */
RemoteDAO.callJCL11116 = function (obj, callback) {
  var entrust_type = '1', entrust_typeid = '';
  if (!_.isEmpty(obj.groupId)) {
    entrust_type = '2';
    entrust_typeid = obj.groupId
  }
  if (!_.isEmpty(obj.gameId)) {
    entrust_type = '3';
    entrust_typeid = obj.gameId
  }
  var param = {
    'func_id': '11116',
    'type': 'zmq',
    'client_id': obj.clientId + '',
    'USER_CODE': obj.clientId + '',
    'entrust_type': entrust_type + '',
    'entrust_bs': obj.tradeType + '',
    'exchange_type': obj.marketCd + '',
    'stock_code': obj.stockCode + '',
    'entrust_price': (obj.tradePrice || '0') + '',
    'entrust_vol': obj.tradeCount + '',
    'bfollow': obj.bfollow + '',
    'follow_client': obj.followClient + '',
    'entrust_typeid': entrust_typeid + ''
  };
  console.log('11116-买卖委托-param', JSON.stringify(param));
  Bridge.callByJS({
      callback: function (response) {
        if (response.error == '1') {
          console.log('11116-买卖委托-error', response.data);
        } else {
          var decryptData = JSON.parse(decrypt.json2(response.data));
          response.data = decryptData;
          console.log('11116-买卖委托-data', JSON.stringify(response.data.body));
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11116',
      'jsToken': 'JCL11116',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': param,
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};

/**
 * 已成、可撤
 * @param obj
 * @param callback
 * entrust_type 0全部 1、个股 2、组合
 * 已成11117  可撤单:11118
 */
RemoteDAO.callJCL11117OR11118 = function (obj, callback) {
  var param = {
    'func_id': obj.func_id,
    'type': 'zmq',
    'client_id': obj.client_id + '',
    'USER_CODE': obj.client_id + '',
    'start': obj.entrust_type == '2' ? '0' : obj.start + '',
    'limit': obj.entrust_type == '2' ? '1000' : obj.limit + '',
    'entrust_type': obj.entrust_type + ''
  };
  if (typeof (obj.entrust_typeid) !== 'undefined') {
    _.extend(param, {'entrust_typeid': obj.entrust_typeid})
  }
  Bridge.callByJS({
      callback: function (response) {
        if (response.error == '0') {
          var result = decrypt.json2(response.data);
          var data = JSON.parse(result);
          response.data = data;
          console.log(param.func_id + '-data-' + param.entrust_type + ':', data)
        } else {
          console.log(param.func_id + '-error:', response.data);
        }
        callback(response)
      },
      'id': 'nrng',
      'tranCode': 'JCL11117OR11118',
      'jsToken': 'JCL11117OR11118',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': param,
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};
/**
 * 当日委托查询
 * @param obj
 * @param callback
 * entrust_type 0全部 1、个股 2、组合
 */
RemoteDAO.callJCL11119 = function (obj, callback) {
  var param = {
    'func_id': '11119',
    'type': 'zmq',
    'client_id': obj.client_id + '',
    'USER_CODE': obj.client_id + '',
    'start': obj.start + '',
    'limit': obj.limit + '',
    'entrust_type': obj.entrust_type + ''
  };
  if (typeof (obj.entrust_typeid) !== 'undefined') {
    _.extend(param, {'entrust_typeid': obj.entrust_typeid})
  }
  Bridge.callByJS({
      callback: function (response) {
        console.log('11119-当日委托查询-param:', JSON.stringify(param));
        if (response.error == '0') {
          var result = decrypt.json2(response.data);
          var data = JSON.parse(result);
          response.data = data;
          console.log('11119-当日委托查询-data:' + data);
        } else {
          console.log('11119-error', response.data);
        }
        if (_.isFunction(callback)){
          callback(response)
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11119',
      'jsToken': 'JCL11119',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': param,
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};

/**
 * 查询用户历史成交记录，只能查询30天以内的
 * @param clientId      用户代码
 * @param start         起始序号
 * @param limit         请求行数
 * @param startDate     开始日期
 * @param endDate       结束日期
 * @param entrustType   交易类型 0.所有 1.股票 2.组合 3.比赛
 * @param entrustTypeId id
 * @param callback      回调function
 */
RemoteDAO.callJCL11121 = function (clientId, start, limit, startDate, endDate, entrustType, entrustTypeId, callback) {
  Bridge.callByJS({
    callback: function (response) {
      // alert(response.data)
      if (response.error === '0') {
        var result = decrypt.json2(response.data);
        var data = JSON.parse(result);
        response.data = data;
        console.log('11121-历史成交记录-data:',data);
      } else {
        console.error('JCL11121', response);
      }
       if (_.isFunction(callback))
          callback(response)
    },
    'id': 'nrng',
    'tranCode': 'JCL11121',
    'jsToken': 'JCL11121',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {
      'type': 'zmq',
      'func_id': '11121',
      'client_id': clientId + '',
      'USER_CODE': clientId + '',
      'start': start + '',
      'limit': limit + '',
      'start_date': startDate + '',
      'end_date': endDate + '',
      'entrust_type': entrustType + '',
      'entrust_typeid': entrustTypeId + ''
    },
    'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
  })
};

/**
 * 个股持仓情况：
 *
 * @param clientId 用户代码
 * @param start 起始序号，0 开始
 * @param limit 请求行数
 * @param callback 接口调用成功后的回调函数
 */
RemoteDAO.callJCL11123 = function (clientId, start, limit, callback) {
  var paramData = {
    'func_id': '11123',
    'type': 'zmq',
    'client_id': clientId,
    'user_code': clientId,
    'start': start,
    'limit': limit
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('11123-个股持仓情况-error:', response.data);
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('11123-个股持仓情况-data:', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL11123',
    'jsToken': 'JCL11123',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 11124：获取我参加的比赛持仓数据
 * @method callJCL11124
 * @param  usercode
 * @param  gameid
 * @param  start
 * @param  limit
 * @param  callback
 */
RemoteDAO.callJCL11124 = function (usercode, gameid, start, limit, callback) {
  Bridge.callByJS({
    callback: function (response) {
      if (response.error === '0') {
        var result = decrypt.json2(response.data);
        var data = JSON.parse(result);
        response.data = data;
        console.log('JCL11124 success:', data);

      } else {
        console.log('JCL11124 error:', response.data);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL11124',
    'jsToken': 'JCL11124',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {
      'type': 'zmq',
      'func_id': '11124',
      'client_id': usercode + '',
      'USER_CODE': usercode + '',
      'game_id': gameid + '',
      'start': start + '',
      'limit': limit + ''
    },
    'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
  })
};

/**
 * 创建组合(不包括偷师)
 * @param client_id 用户 id
 * @param initmoney
 * @param group_name 组合名
 * @param group_wt 股票数组
 * @param callback 调用接口后回调函数
 */
RemoteDAO.callJCL11135 = function (client_id, initmoney, group_name, group_wt, callback) {
  Bridge.callByJS({
    callback: function (response) {
      if (response.error == '1') {
        console.log('11135-创建组合-error:', response.data);
      } else {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        console.log('11135-创建组合-data:', object);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL11135',
    'jsToken': '11135',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {
      'func_id': '11135',
      'type': 'zmq',
      'client_id': client_id + '',
      'USER_CODE': client_id + '',
      'initmoney': initmoney + '',
      'group_name': group_name + '',
      'group_wt': group_wt
    },
    'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
  })
};

/**
 * 买卖原因委托
 *
 * @param obj
 * @param callback
 */
RemoteDAO.callJCL11137 = function (obj, callback) {
  var param = {
    'func_id': '11137',
    'type': 'zmq',
    'client_id': obj.client_id,
    'USER_CODE': obj.client_id,
    'entrust_type': obj.entrust_type,
    'entrust_typeid': obj.entrust_typeid,
    'entrust_no': obj.entrust_no,
    'reason1': obj.reason1,
    'reason2': obj.reason2,
    'reason3': obj.reason3
  };
  Bridge.callByJS({
      callback: function (response) {
        if (response.error == 0) {
          var decryptData = JSON.parse(decrypt.json2(response.data));
          var body = decryptData.body || {};
          console.log('JCL11137-data', JSON.stringify(body));
        } else {
          console.log('JCL11137-error', response.data);
        }
        callback(response)
      },
      'id': 'nrng',
      'tranCode': 'JCL11137',
      'jsToken': 'JCL11137',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': param,
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};

/**
 * 查询用户组合列表
 * @param clientId 用户 id
 * @param isBody 是否只返回body 1只返回body
 * @param callback 调用接口后回调函数
 */
RemoteDAO.callJCL11138 = function (clientId, isBody, callback, errorHandler) {
  var paramData = {
    'func_id': '11138',
    'type': 'zmq',
    'client_id': clientId
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('11138-查询用户组合-error:', response.data);
        if (!isBody || Number(isBody) === 0) {
          callback(response)
        } else {
          errorHandler(response)
        }
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('11138-查询用户组合-data:', json);
        if (isBody && isBody == '1') {
          callback(json)
        } else {
          /*
           * {'header':{'errorCode':'000000','errorMsg':'success'},
           * 'body':{'status':0,'grouplist':[{'total_profitrate':0,'total_profit':0,'statue':0,
           * 'group_name':'%E7%89%9B%E8%82%A1%E7%BB%84%E5%90%882','group_id':'8debdfda-98b4-42e8-aa88-c0724bd64cc3'},
           * {'total_profitrate':0,'total_profit':0,'statue':0,'group_name':'ţ¹É×éºÏ1',
           * 'group_id':'570cfe59-3f16-421e-80ce-d8a0dbfac276'}],'describe':''}}
           * */
          callback(response)
        }
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL11138',
    'jsToken': 'JCL11138',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 查询推荐的牛人最近操作
 * @param userList 用户 id 字符串，逗号分隔
 * @param client_id 用户 id
 * @param callback 调用接口后回调函数
 */
RemoteDAO.callJCL11139 = function (userList, client_id, callback) {
  var paramData = {
    'func_id': '11139',
    'type': 'zmq',
    'user_list': userList.join(),
    'client_id': client_id
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.error('11139-查询推荐的牛人最近操作-error:', response.data)
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('11139-查询推荐的牛人最近操作-data:', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL11139',
    'jsToken': '11139',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 查询用户组合
 * @param client_id 用户 id
 * @param group_id 组合id
 * @param callback 调用接口后回调函数
 */
RemoteDAO.callJCL11140 = function (client_id, group_id, callback) {
  var paramData = {
    'func_id': '11140',
    'type': 'zmq',
    'client_id': client_id + '',
    'group_id': group_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('11140-查询用户组合详情-error:', response)
      } else {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('11140-查询用户组合详情-data:', response)
      }
      if (_.isFunction(callback)) {
        callback(response)
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL11140',
    'jsToken': 'JCL11140',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 查询组合持仓
 * @param client_id 用户 id
 * @param group_id 组合id
 * @param start
 * @param limit
 * @param callback 调用接口后回调函数
 */
RemoteDAO.callJCL11141 = function (client_id, group_id, start, limit, callback) {
  var paramData = {
    'func_id': '11141',
    'type': 'zmq',
    'start': start + '',
    'limit': limit + '',
    'client_id': client_id + '',
    'group_id': group_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('11141-查询组合持仓-error:', response.data);
      } else {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('11141-查询组合持仓-data:', object);
        response.data = object;
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL11141',
    'jsToken': 'JCL11141',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 查询组合调仓
 * @param client_id 用户 id
 * @param group_id 组合id
 * @param callback 调用接口后回调函数
 */
RemoteDAO.callJCL11142 = function (client_id, group_id, callback) {
  var paramData = {
    'func_id': '11142',
    'type': 'zmq',
    'client_id': client_id + '',
    'group_id': group_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('11142-查询组合调仓-error:', response.data)
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('11142-查询组合调仓-data:', json);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL11142',
    'jsToken': 'JCL11142',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 我参加的比赛资产数据，其中包含排名信息，累计收益率等，返回的数据格式：
 *
 * @param clientId
 * @param gameId
 * @param callback
 */
RemoteDAO.callJCL11143 = function (clientId, gameId, callback) {
  var paramData = {
    'func_id': '11143',
    'type': 'zmq',
    'game_id': gameId + '',
    'client_id': clientId + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (str) {
      if (str.error == '1') {
        console.log('JCL11143-error:', str.data);
        return
      } else {
        var result = decrypt.json2(str.data);
        var object = JSON.parse(result);
        str.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('JCL11143-data :', object)
      }

      if (_.isFunction(callback)) {
        callback(str)
      }
    }, 'id': 'nrng',
    'tranCode': 'JCL11143',
    'jsToken': 'JCL11143',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  //我参加的比赛资产数据
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 组合名称验证接口
 * @param group_name
 * @param client_id
 * @param callback
 */
RemoteDAO.call11147 = function (group_name, client_id, callback) {
  Bridge.callByJS({
      callback: function (response) {
        if (response.error == '1') {
          console.log('11147-组合名称验证-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var object = JSON.parse(result);
          response.data = object;
          console.log('11147-组合名称验证-data:', object)
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11147',
      'jsToken': '11147',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': {
        'func_id': '11147',
        'type': 'zmq',
        'client_id': client_id + '',
        'USER_CODE': client_id + '',
        'group_name': group_name + ''
      },
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};

/**
 * 组合修改名称
 *
 * @param clientId
 * @param groupid
 * @param groupName
 * @param callback
 */
RemoteDAO.callJCL11148 = function (clientId, groupId, groupName, callback) {
  Bridge.callByJS({
      callback: function (response) {
        if (response.error == '1') {
          console.log('11148-组合修改名称-error:', response)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          console.log('11148-组合修改名称-data:', response);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11148',
      'jsToken': 'JCL11148',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': {
        'func_id': '11148',
        'type': 'zmq',
        'client_id': clientId,
        'USER_CODE': clientId,
        'group_id': groupId,
        'group_name': groupName
      }, 'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};

/**
 * 查询与当前登录用户，持仓相似板块的牛人列表，最多5个
 * @param clientId
 * @param callback
 */
RemoteDAO.callJCl11155 = function (clientId, callback) {
  var paramData = {
    'func_id': '11155',
    'type': 'zmq',
    'client_id': clientId
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      var error = response.error;
      if (error == 1) {
        console.error('11155-持仓相似板块牛人-error:', response.data)
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('11155-持仓相似板块牛人-data:', response);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng',
    'tranCode': 'GT11155',
    'jsToken': '11155',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 我偷师的组合
 * @param client_id
 * @param groupId
 * @param start
 * @param limit
 * @param callback
 */
RemoteDAO.callJCl11156 = function (client_id, groupId, start, limit, callback) {
  Bridge.callByJS({
      callback: function (response) {
        var error = response.error;
        if (error == 1) {
          console.error('11156我偷师的组合-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var object = JSON.parse(result);
          response.data = object;
          console.log('11156我偷师的组合-data', object);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      }, 'id': 'nrng', 'tranCode': 'GT11156', 'jsToken': '11156', 'isEncrypt': 'false', 'transmitMode': 'get', 'param': {
        'func_id': '11156',
        'type': 'zmq',
        'client_id': client_id + '',
        'USER_CODE': client_id + '',
        'group_id': groupId,
        'start': start + '',
        'limit': limit + ''
      },
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};

/**
 * 组合一键清仓
 * @param client_id 用户 id
 * @param entrust_type 此值为2
 * @param sh_entrust_bs
 * @param sz_entrust_bs
 * @param entrust_typeid
 * @param callback 调用接口后回调函数
 */
RemoteDAO.callJCL11158 = function (client_id, entrust_type, sh_entrust_bs, sz_entrust_bs, entrust_typeid, callback) {
  Bridge.callByJS({
      callback: function (response) {
        if (response.error == '1') {
          console.log('11158-组合一键清仓-error:', response)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          console.log('11158-组合一键清仓-data:', response);
        }

        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11158',
      'jsToken': 'JCL111578',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': {
        'func_id': '11158',
        'type': 'zmq',
        'client_id': client_id + '',
        'USER_CODE': client_id + '',
        'entrust_type': entrust_type + '',
        'sh_entrust_bs': sh_entrust_bs + '',
        'sz_entrust_bs': sz_entrust_bs + '',
        'entrust_typeid': entrust_typeid + ''
      },
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};

/**
 * 偷师组合
 * @param param
 * @param callback 调用接口后回调函数
 * client_id 用户 id
 * group_id 组合id
 * group_name 组合名
 * steal_groupid 所偷组合id
 * group_wt 股票数组

 */
RemoteDAO.callJCL11159 = function (param, callback) {
  console.log(JSON.stringify(param));
  Bridge.callByJS({
      callback: function (response) {
        if (response.error == '1') {
          console.log('11159-偷师组合-error:', response.data);
        } else {
          var result = decrypt.json2(response.data);
          var object = JSON.parse(result);
          response.data = object;
          console.log('11159-偷师组合-data:', object);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11159',
      'jsToken': '11159',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': {
        'func_id': '11159',
        'type': 'zmq',
        'client_id': param.client_id + '',
        'USER_CODE': param.client_id + '',
        'initmoney': param.initmoney + '',
        'group_name': param.group_name + '',
        'steal_client_id': param.steal_client_id + '',
        'steal_groupid': param.steal_groupid + '',
        'steal_nickname': param.steal_nickname + '',
        'steal_groupname': param.steal_groupname + '',
        'group_wt': param.group_wt
      },
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};

/**
 * 查询今日偷师次数
 * @param client_id
 * @param callback
 */
RemoteDAO.callJCL11160 = function (client_id, callback) {
  Bridge.callByJS({
      callback: function (response) {
        if (response.error == '1') {
          console.error('11160-今日偷师次数查询-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          console.log('11160-今日偷师次数查询-data:', response);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11160',
      'jsToken': 'JCL11160',
      'isEncrypt': 'false',
      'transmitMode': 'get',
      'param': {
        'func_id': '11160',
        'type': 'zmq',
        'client_id': client_id + '',
        'USER_CODE': client_id + ''
      },
      'localParameter': {'mobile': 'phone_no', 'password': 'stock_pwd'}
    }
  )
};

/**
 * 关停组合
 * @param client_id
 * @param callback
 */
RemoteDAO.callJCL11161 = function (client_id,group_id, callback) {
  var paramData = {
    'func_id': '11161',
    'type': 'zmq',
    'group_id': group_id +'',
    'client_id': client_id + ''
//  'USER_CODE': client_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
      callback: function (response) {
        if (response.error == '1') {
          console.error('11161-关停组合-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          //增加存入token的逻辑
          CommonUtil.saveyyzToken(JSON.parse(result).header);
          console.log('11161-关停组合-data:', response);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11161',
      'jsToken': 'JCL11161',
      'isEncrypt': 'false',
      'transmitMode': 'get'
  }
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 开放式基金当日委托查询
 * params:{ client_id,entrust_type,entrust_typeid, start, limit}
 */
RemoteDAO.callJCL11163 = function (params, callback) {
  var paramData = {
    'func_id': '11163',
    'type': 'zmq',
    'entrust_type':params.entrust_type + '',
    'entrust_typeid': params.entrust_typeid + '',
    'start': params.start + '',
    'limit': params.limit + '',
    'client_id': params.client_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
      callback: function (response) {
        if (response.error == '1') {
          console.error('11163-开放式基金当日委托查询-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          //增加存入token的逻辑
          CommonUtil.saveyyzToken(JSON.parse(result).header);
          console.log('11163-开放式基金当日委托查询-data:', response);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11163',
      'jsToken': 'JCL11163',
      'isEncrypt': 'false',
      'transmitMode': 'get'
  }
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 开放式基金委托撤单
 * params:{client_id, ofcode, entrust_no}
 */
RemoteDAO.callJCL11164 = function (params, callback) {
  var paramData = {
    'func_id': '11164',
    'type': 'zmq',
    'ofcode':params.ofcode + '',
    'entrust_no': params.entrust_no + '',
    'client_id': params.client_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
      callback: function (response) {
        if (response.error == '1') {
          console.error('11164-开放式基金委托撤单-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          //增加存入token的逻辑
          CommonUtil.saveyyzToken(JSON.parse(result).header);
          console.log('11164-开放式基金委托撤单-data:', response);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11164',
      'jsToken': 'JCL11164',
      'isEncrypt': 'false',
      'transmitMode': 'get'
  }
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 开放式基金信息查询
 * params:{client_id, ofcode, start, limit}
 */
RemoteDAO.callJCL11165 = function (params,callback) {
  var paramData = {
    'func_id': '11165',
    'type': 'zmq',
    'ofcode':params.ofcode + '',
    'start': params.start + '',
    'limit': params.limit + '',
    'client_id': params.client_id + '',
    'ofstatue':'0'
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
      callback: function (response) {
        if (response.error == '1') {
          console.error('11165-开放式基金信息查询-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          //增加存入token的逻辑
          CommonUtil.saveyyzToken(JSON.parse(result).header);
          console.log('11165-开放式基金信息查询-data:', response);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11165',
      'jsToken': 'JCL11165',
      'isEncrypt': 'false',
      'transmitMode': 'get'
  }
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 开放式基金分红方式
 * params:{client_id,ofcode,dividmethod}
 */
RemoteDAO.callJCL11166 = function (params,callback) {
  var paramData = {
    'func_id': '11166',
    'type': 'zmq',
    'ofcode':params.ofcode + '',
    'dividmethod': params.dividmethod + '',
    'client_id': params.client_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
      callback: function (response) {
        if (response.error == '1') {
          console.error('11166-开放式基金分红方式-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          //增加存入token的逻辑
          CommonUtil.saveyyzToken(JSON.parse(result).header);
          console.log('11166-开放式基金分红方式-data:', response);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11166',
      'jsToken': 'JCL11166',
      'isEncrypt': 'false',
      'transmitMode': 'get'
  }
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 查询开放式基金历史成交记录
 * params:{client_id, entrust_type, entrust_typeid, start, limit, start_date, end_date}
 */
RemoteDAO.callJCL11168= function (params,callback) {
  var paramData = {
    'func_id': '11168',
    'type': 'zmq',
    'entrust_type':params.entrust_type + '',
    'entrust_typeid': params.entrust_typeid + '',
    'start': params.start + '',
    'limit': params.limit + '',
    'start_date': params.start_date + '',
    'end_date': params.end_date + '',
    'client_id': params.client_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
      callback: function (response) {
        if (response.error == '1') {
          console.error('11168-查询开放式基金历史成交记录-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          //增加存入token的逻辑
          CommonUtil.saveyyzToken(JSON.parse(result).header);
          console.log('11168-查询开放式基金历史成交记录-data:', response);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11168',
      'jsToken': 'JCL11168',
      'isEncrypt': 'false',
      'transmitMode': 'get'
  }
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 查询基金最大量
 * params:{client_id,ofcode,entrust_bs, entrust_type, entrust_typeid }
 */
RemoteDAO.callJCL11169= function (params,callback) {
  var paramData = {
    'func_id': '11169',
    'type': 'zmq',
    'ofcode' : params.ofcode + '',
    'entrust_bs': params.entrust_bs + '',
    'entrust_type' : params.entrust_type + '',
    'entrust_typeid' : params.entrust_typeid + '',
    'client_id': params.client_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
      callback: function (response) {
        if (response.error == '1') {
          console.error('11169-查询基金最大量-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          //增加存入token的逻辑
          CommonUtil.saveyyzToken(JSON.parse(result).header);
          console.log('11169-查询基金最大量-data:', response);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11169',
      'jsToken': 'JCL11169',
      'isEncrypt': 'false',
      'transmitMode': 'get'
  }
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 开放式基金资金信息
 * @param client_id
 * @param callback
 */
RemoteDAO.callJCL11170 = function (client_id, callback) {
  var paramData = {
    'func_id': '11170',
    'type': 'zmq',
    'client_id': client_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
      callback: function (response) {
        if (response.error == '1') {
          console.error('11170-开放式基金资金信息-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          //增加存入token的逻辑
          CommonUtil.saveyyzToken(JSON.parse(result).header);
          console.log('11170-开放式基金资金信息-data:', response);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11170',
      'jsToken': 'JCL11170',
      'isEncrypt': 'false',
      'transmitMode': 'get'
  }
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 开放式基金持仓
 * params.:{client_id, start, limit}
 */
RemoteDAO.callJCL11171 = function (params, callback) {
  var paramData = {
    'func_id': '11171',
    'type': 'zmq',
    'start' : params.start + '',
    'limit' : params.limit + '',
    'client_id': params.client_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
      callback: function (response) {
        if (response.error == '1') {
          console.error('11171-开放式基金持仓-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          //增加存入token的逻辑
          CommonUtil.saveyyzToken(JSON.parse(result).header);
          console.log('11171-开放式基金持仓-data:', response);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11171',
      'jsToken': 'JCL11171',
      'isEncrypt': 'false',
      'transmitMode': 'get'
  }
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 开放式基金历史委托记录
 * params:{ client_id, start, limit,entrust_type,entrust_typeid, start_date ,end_date}
 */
RemoteDAO.callJCL11172 = function (params, callback) {
  var paramData = {
    'func_id': '11172',
    'type': 'zmq',
    'start' : params.start + '',
    'limit' : params.limit + '',
    'entrust_type' : params.entrust_type + '',
    'entrust_typeid' : params.entrust_typeid + '',
    'start_date' : params.start_date + '',
    'end_date' : params.end_date + '',
    'client_id': params.client_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
      callback: function (response) {
        if (response.error == '1') {
          console.error('11172-开放式基金历史委托记录-error:', response.data)
        } else {
          var result = decrypt.json2(response.data);
          var json = JSON.parse(result);
          response.data = json;
          //增加存入token的逻辑
          CommonUtil.saveyyzToken(JSON.parse(result).header);
          console.log('11172-开放式基金历史委托记录-data:', response);
        }
        if (_.isFunction(callback)) {
          callback(response);
        }
      },
      'id': 'nrng',
      'tranCode': 'JCL11172',
      'jsToken': 'JCL11172',
      'isEncrypt': 'false',
      'transmitMode': 'get'
  }
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 收益曲线：
 *
 * @param args
 * @param callback
 * clientId
 * groupId
 * entrustType
 */
RemoteDAO.callJCL30000 = function (args, callback) {
  var paramData = {
    'func_id': '30000',
    'type': 'zmq',
    'client_id': args.clientId,
    'group_id': args.groupId,
    'data_type': args.dataType,
    'entrust_type': args.entrustType
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('30000-收益曲线-error:' + response.data)
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('30000-收益曲线-data:', response)
      }

      if (_.isFunction(callback)) {
        callback(response)
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL30000',
    'jsToken': 'JCL30000',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 牛人都在买 牛人都在卖：
 *
 * @param entrust_bs
 * @param num
 * @param start
 * @param callback
 */
RemoteDAO.callJCL30006 = function (entrust_bs, num, start, callback) {
  var paramData = {
    'func_id': '30006',
    'type': 'zmq',
    'entrust_bs': entrust_bs + '',
    'num': num + '',
    'start': start + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (Number(response.error) == 0) {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('30006牛人都在' + (entrust_bs == 0 ? '买' : '卖') + ':', object)
      } else {
        console.log('30006牛人都在' + (entrust_bs == 0 ? '买' : '卖') + ':', response.data)
      }
      if (_.isFunction(callback)) {
        callback(response)
      }
    }, 'id': 'nrng',
    'tranCode': 'JCL30006',
    'jsToken': '30006' + entrust_bs + '',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 牛股组合：
 *
 * @param num
 * @param start
 * @param sorttype
 * @param callback
 */
RemoteDAO.callJCL30008 = function (num, start, sorttype, callback) {
  var paramData = {
    'func_id': '30008',
    'type': 'zmq',
    'start': start + '',
    'num': num + '',
    'sorttype': sorttype + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      var flag = '';
      switch (sorttype) {
        case 2:
          flag = '日收益';
          break;
        case 3:
          flag = '月收益';
          break;
        case 4:
          flag = '总收益';
          break;
        case 1:
          flag = '人气组合';
          break;
      }
      // console.log('30008-param',JSON.stringify(param))
      if (Number(response.error) == 0) {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('30008-最牛组合' + flag + '-data:', object);
      } else {
        console.log('30008-最牛组合' + flag + '-error:' + response.data);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    }, 'id': 'nrng',
    'tranCode': 'GT1003',
    'jsToken': '30008' + sorttype + '',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 动态首页随机推送数据
 *
 * @param callback
 */
RemoteDAO.callJCL30010 = function (callback) {
  var paramData = {
    'func_id': '30010',
    'type': 'zmq'
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('30010-动态首页随机推送数据-error：', response.data);
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('30010-动态首页随机推送数据-data', response);
      }
      if (_.isFunction(callback)) {
        callback(response)
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL30010',
    'jsToken': 'JCL30010',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam);
};

/**
 * 30012：查询牛人列表（活跃牛人、总收益）
 * @param  sorttype   0活跃牛人，1总收益率，2比赛牛人
 * @param  start   第几页
 * @param  num   一次请求多少条
 * @param  usercode   用户代码
 * @param  callback
 */
RemoteDAO.callJCL30012 = function (sorttype, start, num, usercode, callback) {
  var paramData = {
    'type': 'zmq',
    'func_id': '30012',
    'client_id': usercode + '',
    'num': num,
    'start': start,
    'sorttype': sorttype + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error === '0') {
        var result = decrypt.json2(response.data);
        // console.log('30012-data-牛人列表',result)
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header)
      } else {
        console.log('30012-error-牛人列表', result)
      }
      callback(response)
    },
    'id': 'nrng',
    'tranCode': 'JCL30012',
    'jsToken': 'JCL30012',
    'isEncrypt': 'false',
    'transmitMode': 'get'
    // 'param':param
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 搜索页面模糊搜索接口：
 *
 * @param clientId
 * @param searchType
 * @param fuzzyKey
 * @param callback
 */
RemoteDAO.callJCL30014 = function (clientId, searchType, fuzzyKey, callback) {
  var paramData = {
    'func_id': '30014',
    'type': 'zmq',
    'client_id': clientId + '',
    'searchtype': searchType + '',
    'fuzzykey': fuzzyKey + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (data) {
      var error = data.error;
      if (error == 1) {
        console.log('30014搜索页面模糊搜索接口:' + data.data)
        if (_.isFunction(callback)) {
          callback(data)
        }
      } else {
        var result = decrypt.json2(data.data);
        var object = JSON.parse(result);
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('30014搜索页面模糊搜索接口:', object);
        if (_.isFunction(callback)) {
          callback(object)
        }
      }
    }, 'id': 'nrng',
    'tranCode': 'JCL30014',
    'jsToken': '4',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 组合池中随机 3 条
 * @param callback 调用接口后回调函数
 */
RemoteDAO.callJCL30016 = function (callback) {
  var paramData = {
    'func_id': '30016',
    'type': 'zmq'
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (Number(response.error) === 1) {
        console.log('30016-组合池中随机3条-error:' + response.data);
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('30016-组合池中随机3条-data:', json)
      }
      if (_.isFunction(callback)) {
        callback(response)
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL30016',
    'jsToken': 'JCL30016',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam);
};

/**
 * 组合相似牛人
 * @param args
 * @param callback 调用接口后回调函数
 */
RemoteDAO.callJCL30024 = function (args, callback) {
  var paramData = {
    'func_id': '30024',
    'type': 'zmq',
    'client_id': args.client_id
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('30024-组合相似牛人-error:', response);
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('30024-组合相似牛人-data:', response);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL30024',
    'jsToken': 'JCL30024',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam);
};

/**
 * 查询相似持仓的组合
 * @param client_id 用户 id
 * @param group_id 组合id
 * @param callback 调用接口后回调函数
 */
RemoteDAO.callJCL30026 = function (client_id, group_id, callback) {
  var paramData = {
    'func_id': '30026',
    'type': 'zmq',
    'client_id': client_id + '',
    'group_id': group_id + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('30026-查询相似组合-error:', response.data)
      } else {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('30026-查询相似组合-data:', object);
      }
      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL30026',
    'jsToken': 'JCL30026',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam);
};

/**
 * 查询我参加的多个比赛资产数据
 * @param args
 * @param callback 调用接口后回调函数
 */
RemoteDAO.callJCL30028 = function (args, callback) {
  var paramData = {
    'func_id': '30028',
    'type': 'zmq',
    'client_id': args.client_id,
    'game_id': args.game_id
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.log('30028-我参加的多个比赛资产数据-error:', response.data)
      } else {
        var result = decrypt.json2(response.data);
        var object = JSON.parse(result);
        response.data = object;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('30028-我参加的多个比赛资产数据-success:', response)
      }

      if (_.isFunction(callback)) {
        callback(response)
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL30028',
    'jsToken': 'JCL30028',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 30032：多用户总收益率
 * @method callJCL30032
 * @param  userCodes   用户代码
 * @param callback
 */
RemoteDAO.callJCL30032 = function (userCodes, callback) {
  var paramData = {
    'type': 'zmq',
    'func_id': '30032',
    'client_id': userCodes
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.error('30032-多用户总收益率-error：', response)
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;

        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('30032-多用户总收益率-data：', response)
      }

      if (_.isFunction(callback)) {
        callback(response)
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL30032',
    'jsToken': 'JCL30032',
    'isEncrypt': 'false',
    'transmitMode': 'get'
    // 'param':param
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam);
};

/**
 * 30034：一个或多个牛人信息(总收益，最大回撤，近一月操作...)
 * @method callJCL30034
 * @param  userCodes   用户代码
 * @param callback
 */
RemoteDAO.callJCL30034 = function (userCodes, callback) {
  var paramData = {
    'type': 'zmq',
    'func_id': '30034',
    'client_id': userCodes
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error == '1') {
        console.error('30034-一个或多个牛人信息-error：', response);
      } else {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;

        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('30034-一个或多个牛人信息-data：', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'nrng',
    'tranCode': 'JCL30034',
    'jsToken': 'JCL30034',
    'isEncrypt': 'false',
    'transmitMode': 'get'
    // 'param':param
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};



/**
 * 合并接口，获取订阅的牛人列表(合并用户中心12008301和金策略11139）
 * @param usercode      用户代码
 * @param actionType    操作标志 0：牛人排行榜  1：自己已订阅   9：随机
 * @param pagesize      页大小
 * @param pageno        页码
 * @param totalFlag     0：不统计，查询列表   1：统计，出参中，TOTAIL_NUM有效
 * @param callback      回调函数
 */
RemoteDAO.callHB001 = function (usercode, actionType, pagesize, pageno, totalFlag, callback) {
  Bridge.callByJS({
    callback: function (response) {
      if (response.error === '0') {
        var result = decrypt.json2(response.data);
        var data = JSON.parse(result);
        response.data = data;
        console.log('HB001-response', response);
      } else {
        console.error('HB001', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'expert_niugu',
    'tranCode': 'GT1002',
    'jsToken': 'expert_niugu',
    'isEncrypt': 'false',
    'transmitMode': 'get',
    'param': {
      'branch_no': '0',
      'user_code': usercode + '',
      'password': '',
      'USER_TOKEN': '',
      'CUST_CODE': '',
      'MOBILE': '',
      'OP_SITE': '127.0.0.1',
      'TOKEN_SERIAL_NO': '0',
      'OP_PROGRAM': '',
      'TERMINAL_SOURCE': '13',
      'action_type': actionType,
      'page_size': pagesize,
      'page_no': pageno,
      'TOTAL_FLAG': totalFlag
    },
    'localParameter': {}
  })
};

/**
 * 合并接口，获取我的比赛列表(合并用户中心 12008303 和金策略 11143）
 * @param userCode      用户代码
 * @param actionFlag   操作标志 0：所有  1：参加   2：创建
 * @param pageSize      页大小
 * @param pageNo        页码
 * @param totalFlag
 * @param callback      回调函数
 */
RemoteDAO.callHB002 = function (userCode, actionFlag, pageSize, pageNo, totalFlag, callback) {
  var paramData = {
    'branch_no': '0',
    // 'user_code':userCode + '',
    'password': '',
    'USER_TOKEN': '',
    'CUST_CODE': '',
    'MOBILE': '',
    'OP_SITE': '127.0.0.1',
    'TOKEN_SERIAL_NO': '0',
    'OP_PROGRAM': '',
    'TERMINAL_SOURCE': '13',
    'action_flag': actionFlag + '',
    'page_size': pageSize + '',
    'page_no': pageNo + '',
    'TOTAL_FLAG': totalFlag
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error === '0') {
        var result = decrypt.json2(response.data);
        var data = JSON.parse(result);
        response.data = data;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('HB002-response', response);
      } else {
        console.error('HB002-error', response.data);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'expert_niugu',
    'tranCode': 'GT1001',
    'jsToken': 'expert_niugu2' + actionFlag + '', //取参加和创建时以区分
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam)
};

/**
 * 合并接口，比赛详情页（UC12008315 查询比赛参赛人员，UC12000104 查询比赛参赛人员的基本资料，JCL11143 查询每个用户的排名、累计收益率）
 * @param usercode      用户代码
 * @param gameid        比赛id
 * @param callback      回调函数
 * @param pageSize
 * @param pageNo
 * @param gameStep
 */
RemoteDAO.callHB003 = function (usercode, gameid, pageSize, pageNo, gameStep, callback) {
  var paramData = {
    'user_code':usercode + '',
    'game_id': gameid + '',
    'page_size': pageSize + '',
    'page_no': pageNo + '',
    'game_step': gameStep + ''
  };
  var param = CommonUtil.setToken(paramData);
  var bridgeParam = {
    callback: function (response) {
      if (response.error === '0') {
        var result = decrypt.json2(response.data);
        var json = JSON.parse(result);
        response.data = json;
        //增加存入token的逻辑
        CommonUtil.saveyyzToken(JSON.parse(result).header);
        console.log('HB003-data:', response);
      } else {
        console.error('HB003', response);
      }

      if (_.isFunction(callback)) {
        callback(response);
      }
    },
    'id': 'expert_niugu',
    'tranCode': 'GT1003',
    'jsToken': 'expert_niugu3',
    'isEncrypt': 'false',
    'transmitMode': 'get'
  };
  var finalParam = CommonUtil.setTouristParam(param, bridgeParam);
  Bridge.callByJS(finalParam);
};

export default RemoteDAO
